package etf.pia.entity;
// Generated Feb 13, 2014 1:21:45 AM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Prijava generated by hbm2java
 */
@Entity
@Table(name="prijava"
    ,catalog="pia"
)
public class Prijava  implements java.io.Serializable {


     private Integer idPrijava;
     private Student student;
     private byte[] fajl;
     private Set<Spiskovi> spiskovis = new HashSet<Spiskovi>(0);

    public Prijava() {
    }

	
    public Prijava(Student student) {
        this.student = student;
    }
    public Prijava(Student student, byte[] fajl, Set<Spiskovi> spiskovis) {
       this.student = student;
       this.fajl = fajl;
       this.spiskovis = spiskovis;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id_prijava", unique=true, nullable=false)
    public Integer getIdPrijava() {
        return this.idPrijava;
    }
    
    public void setIdPrijava(Integer idPrijava) {
        this.idPrijava = idPrijava;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="student", nullable=false)
    public Student getStudent() {
        return this.student;
    }
    
    public void setStudent(Student student) {
        this.student = student;
    }

    
    @Column(name="fajl")
    public byte[] getFajl() {
        return this.fajl;
    }
    
    public void setFajl(byte[] fajl) {
        this.fajl = fajl;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="spiskovi_prijava", catalog="pia", joinColumns = { 
        @JoinColumn(name="prijava", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="spiskovi", nullable=false, updatable=false) })
    public Set<Spiskovi> getSpiskovis() {
        return this.spiskovis;
    }
    
    public void setSpiskovis(Set<Spiskovi> spiskovis) {
        this.spiskovis = spiskovis;
    }




}


